<?php
/**
 *	@name AbstractTimeSheetItem
 *	@copyright : SMART - ULg (www.smart.ulg.ac.be)		
 *
**/


/**
 * Class AbstractTimeSheetItem : 
 * 
 * 
 * $Rev$ 
 * $LastChangedRevision$
 * $LastChangedBy$
 * $LastChangedDate$
 * $HeadURL$
 *
 * @name ProjectsListBroker
 * @package webservices/broker
 * @author : JPh HUMBLET
 * @copyright : SMART - ULg (www.smart.ulg.ac.be)
 * @category : ExAMS::Core
 *
**/

require_once("../classes/SmartXML/SmartXMLElement.php");

class AbstractTimeSheetItem extends SmartXMLElement
{
	
	
	/**
	 * DateAsString
	 * 
	 *
	 * @return String
	 * @author jph (jp.humblet@ulg.ac.be)
	**/
	public function StartDate($fmt="String") {
		if (!isset($this->Date)) {
			return "n/a";
		}
		$year = substr( $this->Date, 0, 4);
		$month = substr( $this->Date, 5, 2 );
		$day = substr( $this->Date, 8, 2 );
		$r = $day."/".$month."/".$year;
		return $r;
	}


	/**
	 * iso2String
	 * ansforms ISO8601 format in human readable String 
	 *
	 * @return String
	 * @author jph (jp.humblet@ulg.ac.be)
	**/
	public function iso2String() {
		if (ISODuration::is_duration( (string) $this )) {
			$unix = ISODuration::duration_to_string($this);
		} else {
			$unix = "0";
		}
		return $unix;
	}


}


?>